package com.cxd.app.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cxd.app.entity.base.LoanBase;
import com.cxd.app.entity.base.UserBase;
import com.cxd.app.entity.base.UserPointBase;
import com.cxd.app.mapper.read.RBeanMapper;
import com.cxd.base.util.wtj.BUtils;

/**
 * <一句话功能简述> <功能详细描述>
 * @author wtj
 * @date 2016年5月5日 上午9:28:38
 * @company CXD
 * @version [Copyright (c) 2016 V001]
 */
@Service("beanService")
public class BeanService {
	
	@Resource
	public RBeanMapper rbeanMapper;
	
	/* 根据用户ID获取用户实体  */
	public UserBase getUserById(String userId){
		return BUtils.tableMapToBean(rbeanMapper.getUserById(userId),UserBase.class);
	} 
	
	/* 根据借款ID获取借款实体  */
	public LoanBase getLoanById(String loanId){
		return BUtils.tableMapToBean(rbeanMapper.getLoanById(loanId), LoanBase.class);
	}
	
	/* 根据用户ID获取用户积分  */
	public UserPointBase getUserPointByUserId(String userId){
		return BUtils.tableMapToBean(rbeanMapper.getUserPointByUserId(userId), UserPointBase.class);
	}
}
